Copyright: Visual Help ® 1993-1994 Firas Bushnaq


Technical Information
Form Aide 2.0

Product Overview

Programmer Interface

Changes to Your Application's INI File


Product Overview

Form Aide 2.0 is an OCX that saves programmers from repetitively coding common form functions. It also simplifies the use of many new features in Windows '95.

Form Aide 2.0 allows you to easily accomplish the following:

•	Center Forms

•	Keep Forms Always On Top

•	Remember Last Window Size, Position and State

•	Resize Controls Proportionally as the Form Resizes

•	Capture Windows 95 Plug-N-Play Device Change Messages

•	Capture Windows 95 Plug-N-Play Display Resolution Change Messages

•	Add a Form to the Windows 95 Tool Tray

•	Add an Item to the System Menu


Programmer Interface

This topic discusses the various properties, methods and events used to accomplish the tasks listed in the Product Overview. A detailed reference describing the use of each property, method and event is available in the Form Aide Help file.

Adding a Form to the Tool Tray

Adding an Item to the System Menu

Capturing Plug-N-Play Messages

Positioning Forms

Resizing Controls Proportionally


Tool Tray
Adding a Form to the Tool Tray

To add a form to the Windows 95 tool tray, either set the DisplayInToolTray property to True or use the AddToolTray method.

This enables the following events to fire:
TrayMouseMove, TrayLeftBtnDown, TrayLeftBtnUp, TrayRightBtnDown, TrayRightBtnUp. These events are triggered when the user performs the indicated mouse actions over the form's icon in the tool tray.

To remove a form from the Windows 95 tool tray, either set the DisplayInToolTray property to False or use the DeleteToolTray method.

The icon used is the form's icon. The form's caption is used as the tool tip. To change the icon or caption after the form is in the tool tray, change these properties of the form, then use the UpdateToolTray method.


System Menu
Adding an Item to the System Menu

You can add an item to the system menu simply by setting the property SystemMenuCaption to any text value.

To separate the new item from the other menu items with a bar, set AddBarOnSysMenu to True. This property has no effect unless the SystemMenuCaption property is set.

You may alter the state of the menu item with the properties SystemMenuEnabled and/or SystemMenuChecked.

The SystemMenuClick event is triggered whenever the user selects the new system menu item.


Plug N Play
Capturing Plug-N-Play Messages

There are two types of Plug-N-Play messages that Windows 95 allows you to capture. The first are device messages, such as whether or not a CD-ROM was inserted or removed, and the second are display resolution change messages.

Device change messages trigger Form Aide's PnPDeviceMsg event.

Display resolution change messages trigger Form Aide's PnPDisplayChange event.


Positioning Forms

A form's opening position can be set by either the RememberLast... properties or the CenterForm property. The two can be combined in either order using the CenterForm First property.

To open a form in the center of the screen, set CenterForm to True.

To open a form where the user last moved it before closing it, set RememberLastPosition to True.

To open a form at the same size it was just before it was closed, set RememberLastSize to True.

To open a form in the window state (minimized, maximized or normal) it was before it was last closed, set RememberLastState to True.

CenterFormFirst centers the form before applying any of the RememberLast... properties to it if it is set to True. It applies the RememberLast... properties first then centers the form if it is set to False.

The form's last position, size and state are automatically recorded in your program's INI file, no matter what the RememberLast... property settings are, whenever the form is closed. To update these settings at any other time, use the SaveLastPosition method.

To keep a form Always On Top, set the AlwaysOnTop property to True at any time.


Proportional Resizing

Setting the ResizeControls property to True causes Form Aide to proportionally resize all the controls on the form whenever the form is resized.

If there are controls you want to exclude or situations in which you don't want a control resized, you can add code to the BeforeResizeControl event.

For any cleanup you may want to do, add code to the AfterResizeControl event or AfterResizeAllControls events.


INI File
Your Application's INI File

Form Aide automatically saves your form's last position, size and state in your application's INI file. If your application does not have an INI file, Form Aide will create one.

This information is used by the RememberLast... properties whenever they are set to True.

The section is called FoormAide and the entries are formatted as follows: FormName=Left,Top,Width,Height,Window State. The example below is an entry for Form1.

[FORMAIDE]
Form1=5,398,840,735,0